package com.gxz.job.example.mapper;

import com.gxz.job.example.pojo.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.Date;
import java.util.Map;

public interface OrderMapper extends Mapper<Order> {
    @Select("SELECT SUM(`total_money`) totalMoneys,SUM(`total_num`) totalNums FROM tb_order WHERE `order_status` = '1' AND `pay_status` = '1'\n" +
            "AND `pay_time` >= #{start} AND `pay_time` < #{end}")
    public Map<String,Object> countOrder(@Param("start") Date startDate,@Param("end") Date endDate);
}
